package db

import (
	"core/config"

	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var DB *gorm.DB

func init() {
	var err error

	DB, err = gorm.Open("mysql", config.Config.DB)

	if err != nil {
		panic("数据库连接失败")
	}
}
